<template>
  <a-layout class="homeLayout">
    <!-- 头部 -->
    <a-layout-header class="head">
      <Head></Head>
    </a-layout-header>

    <a-layout style="height: 90%">
      <a-layout-sider breakpoint="lg" collapsed-width="60" theme="light">
        <Sider :number="1" />
      </a-layout-sider>

      <a-layout>
        <a-layout-content class="content">
          <router-view />
        </a-layout-content>
      </a-layout>
    </a-layout>
  </a-layout>
</template>

<script lang="ts" setup>
import Head from '@/layout/Head.vue';
import Sider from '@/layout/Sider.vue';
import { computed } from 'vue';
import { useRoute } from 'vue-router';

const route = useRoute();
const key = computed(() => {
  return route.path;
});
</script>
<style scoped>
.homeLayout {
  background-color: rgb(242, 247, 250);
  height: 100vh;
}

.head {
  background: #fff;
  width: 100%;
  height: auto;
  max-height: 60px;
  border-bottom: 1px solid #eee;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.031372549);
}

.content {
  height: 100%;
  background: #fafafa;
  overflow: auto;
}

/* 切换动画 */
.fade-transform-leave-active,
.fade-transform-enter-active {
  transition: all 0.3s;
}

.fade-transform-enter {
  opacity: 0;
  transform: translateX(-30px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateX(30px);
}

::-webkit-scrollbar {
  width: 5px;
  /* 滚动条的宽度 */
  height: 5px;
  /* 对于水平滚动条 */
}

::-webkit-scrollbar-thumb {
  background: #888;
  /* 滚动条滑块的颜色 */
  border-radius: 10px;
  /* 滑块边角圆滑度 */
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  /* 滚动条轨道的颜色 */
  border-radius: 10px;
  /* 轨道边角圆滑度 */
}
</style>
